package tk.mybatis.simple.mapper;

import org.apache.ibatis.annotations.Param;
import tk.mybatis.simple.model.SysRole;
import tk.mybatis.simple.model.SysUser;

import java.util.List;

public interface SysUserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    List<SysUser> selectAll();

    List<SysRole> selectRolesByuserId(Long userId);

    int insert2(SysUser sysUser);

    List<SysRole> selectRolesByUserIdAndRoleEnabled(@Param("user") SysUser user, @Param("role") SysRole role);

    List<SysUser> selectSysUserByUserNameOrUserEmail(SysUser sysUser);

    SysUser selectByIdOrUserName(@Param("id") Long id, @Param("userName") String userName);

    List<SysUser> selectByIdList(@Param("idList") List<Long> idList);

    int insertList(@Param("list") List<SysUser> list);

    SysUser selectUserAndRoleById(@Param("id") Long id);

    SysUser selectUserAndRoleByIdSelect(@Param("id") Long id);

    List<SysUser> selectAllUserAndRoles();
}